#ifndef CONVEYOR_MASTER
#define CONVEYOR_MASTER

#include "WPILib.h"
#include "PandroidSettings.h"
#include "DriverConsole.h"

class ConveyorMaster {
public: 
	static ConveyorMaster* GetInstance(NetworkTable *dash, DriverConsole *console);
	void Teleop(bool turretReady);
	void FiringRoutine();
	void LoadingRoutine();
	void UpdateDash();
	void PrintDump();
private:
	ConveyorMaster(NetworkTable *dash, DriverConsole *console);
	~ConveyorMaster();
	
	static ConveyorMaster* _instance; 
	
	typedef enum {goingUp, goingDown};
	DriverConsole *_driverConsole;
	NetworkTable *_smartDash;
	Jaguar *_botRoller;
	CANJaguar *_topRoller;
	Relay *_convRoller;
	DigitalInput *_tLSensor;
	DigitalInput *_mLSensor;
	DigitalInput *_bLSensor;
	AnalogChannel *_bLimit;
	AnalogChannel *_tLimit;
	
	//Variables for controlling the states
	bool _firing;
	bool _loading;
	int _topNum;
	double _startTime;
	int _firingState;
	bool _botReady;
	double _botDelayStart;
	bool _atPos;
};

#endif
